1. Field of the Invention
The present invention relates to a method for adjusting image acquisition parameters to optimize object extraction, which is suitable for different color object extraction and, more particularly, to an object characterized by forming a specific cluster in a color coordinate space after performing a coordinate projection.
2. Description of the Related Art
In a prior art technique, there are two primary image detecting methods for the human face. One is the detection of important features on the face according to the geometric positions of the eyes, nose and lips; these individual features are combined to determine a position of the face. The other method collects a plurality of facial templates, and obtains a standard facial template by way of training steps; a template matching method is then utilized to find the position of the face in the image.
However, in the first method, a predetermined facial model, or its geometric position equivalent, is used to detect the face; if the face in the image is rotated, it is very difficult to detect the correct facial position. In the second method, facial data for various different rotated angles can be provided for training a database, but the template matching method is performed by brute force on every pixel in the image, and this requires an enormous amount of time; in addition, when the image includes two differently sized human faces, the method needs to perform several upscaling or downscaling processes to find the correct positions. As shown in FIG. 1, image X includes two differently sizes human faces F1, F2. A fixed size search window Y is used for scanning every pixel in the image X and sending a selected image area to a human face verification means to determine whether the image area is a face. Since the search window Y has a fixed size, any human face that is larger or smaller than the search window Y may be ignored. Therefore, referring to FIG. 2, several upscaling or downscaling processes must be performed to obtain upscale or downscale images X1, X2, X3, and then the above-mentioned scanning and verification processes are performed to find all of the differently sized human faces F1, F2. Accordingly, the second method will consume enormous amounts of processing time.
One other prior art technique utilizes skin color to reduce the range of the template matching method to accelerate the human face detecting process. Please refer to FIG. 3A. In this prior art technique, large numbers of facial images are first manually collected; the pixels in the skin color regions, as shown in FIG. 3B, are manually extracted, and the color information of these skin color pixels are projected onto a special coordinate system to establish a skin color model for further image processing, such as facial position or feature extraction. Since an image is composed of a plurality of pixels, the color values of the pixels are determined by the light impinging upon the skin and then reflecting into a light sensing device, such as a camera. A skin color model can be established by collecting these color values of the pixels and used as a reference for determining whether further pixels are of a skin color. This prior art technique usually uses the following formula to project the RGB color information of the skin color pixels into an equivalent YCbCr color coordinate:Y=0.2989×R+0.5866×G+0.1145×BCb=−0.1687×R−0.3312×G+0.5000×B,Cr=0.5000×R−0.4183×G−0.0816×B
A tight space collection (skin color model Z1), as shown in FIG. 3C, can be represented by the following math formula:
      if    (          Y      >      128        )    ⁢      {                                                                                        θ                  1                                =                                                      -                    2                                    +                                                            256                      -                      Y                                        16                                                              ;                                                                                                            θ                  2                                =                                  20                  -                                                            256                      -                      Y                                        16                                                              ;                                                                                                            θ                  3                                =                6                            ;                                                θ                  4                                =                                                      -                    8                                    :                                                                        ⁢                          ⁢              if        ⁡                  (                      Y            ≤            128                    )                    ⁢              {                                                                                                                                                                          θ                          1                                                =                        6                                            ;                                                                        θ                          2                                                =                        12                                            ;                                                                                                                                                                                    θ                          3                                                =                                                  2                          +                                                      Y                            32                                                                                              ;                                                                        θ                          4                                                =                                                                              -                            16                                                    +                                                      Y                            16                                                                                              ;                                                                                  ⁢                                                          ⁢                              C                r                                      ≥                                          -                2                            ⁢                              (                                                      C                    b                                    +                  24                                )                                              ;                                          ⁢                                    C              r                        ≥                          -                              (                                                      C                    b                                    +                  17                                )                                              ;                                          ⁢                                    C              r                        ≥                                          -                4                            ⁢                              (                                                      C                    b                                    +                  32                                )                                              ;                                          ⁢                                    C              r                        ≥                          2.5              ⁢                              (                                                      C                    b                                    +                                      θ                    1                                                  )                                              ;                                          ⁢                                    C              r                        ≥                          θ              3                                ;                                          ⁢                                    C              r                        ≥                          0.5              ⁢                              (                                                      θ                    4                                    -                                      C                    b                                                  )                                              ;                                          ⁢                                    C              r                        ≤                                          220                -                                  C                  b                                            6                                ;                                          ⁢                                    C              r                        ≤                                          4                3                            ⁢                              (                                                      θ                    2                                    -                                      C                    b                                                  )                                              ;                    
Accordingly, any pixel projected into a YCbCr coordinate Z is checked to see if it matches the above mathematical formula to determined whether the pixel is in the skin color model and whether it is a skin color pixel; in this manner it is possible to outline a skin color area of this image.
By using the skin color information, it is possible to reduce multiple exhaustive search times, and so the search window needs only to verify the skin color to find a face to accelerate processing efficiency. However, under different lighting conditions and different camera settings, the extracted images may have certain color differences, and the actual skin color value of these images may not match the skin color model based on other conditions or parameters. Therefore, a collection formed by skin color values in a color space will change according to the conditions and parameter settings. Consequently, when the conditions have errors, the determined skin color may be incorrect, which causes broken skin color areas, or added noise in background.
In prior art skin color techniques, such as U.S. Pat. No. 4,987,482, U.S. Pat. No. 6,169,536 and U.S. Pat. No. 6,249,317, image signals are all assumed to mainly include people as objects, and hardware parameters are controlled, or compensation signals are added, by detecting skin color components in the image signal to obtain a better image quality. The skin color detecting techniques utilized by these three patents all separate the image signal into brightness (Y) and color components (R-Y and B-Y), and then use predetermined phase, area or special axis to distinguish skin color and non-skin color signals. However, even though the above-mentioned patents predefine the determination rules for skin color, different cameras, different lighting conditions, and different software and hardware parameters may still affect the image. When the skin color detecting process fails, subsequent processes, such as the adding of compensation signals or the controlling of hardware parameters, will fail as well.
Therefore, it is desirable to provide a method for adjusting image acquisition parameters to optimize object extraction to mitigate and/or obviate the aforementioned problems.